<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>投诉信息</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<link rel="stylesheet" type="text/css" href="../../css/style.css">
	<script type="text/javascript" src="../../js/jquery-1.8.2.js"></script>
	<script type="text/javascript" src="../../js/dialog/jquery.artDialog.source.js?skin=default"></script>
	<script type="text/javascript" src="../../js/dialog/plugins/iframeTools.source.js"></script>
	<script type="text/javascript" src="../../js/datepicker/WdatePicker.js"></script>
	<script type="text/javascript" src="../../js/jquery.ztree.all-3.5.min.js"></script>
	<script type="text/javascript" src="../../js/jquery.form.js"></script>
	<script type="text/javascript" src="../../js/jquery.page.js"></script>
	<script type="text/javascript" src="../../js/base.js"></script>
	<script type="text/javascript">
	$(function(){

		//列表
		$('#list').page({
			url:'tsxx_search.action',
			config:'pageinfo,record,first,last,next,prev,jump',
			items:[{
				name:'complaintsId',
				type:'checkbox'
			},{
				title:'投诉人姓名',
				name:'cname'
			},{
				title:'投诉日期',
				name:'cdate'
			},{
				title:'状态',
				name:'cstatus'
			},{
				title:'详情',
				render:function(row){
					$a = $('<a href="javascript:void(0)")">【详细】</a>');
					$a.click(function(){
						view(row);
					});
					return $a;
				}
			}]
		});

		$(document.search).ajaxForm({
			beforeSubmit:function(formData){
				var param = $(formData).formParam();
				$('#list').page('param',param);
				$('#list').page('show');
				return false;
			}
		});

		$('#updForm').ajaxForm({
			success:function(data){
				$('#list').data('checked').length = 0;
				$('#list').page('show');
			}
		});
		$('#btn_upd').click(function(){
			var ids = $('#list').data('checked');
			if(ids.length != 1){
				$.dialog.alert('一次只能处理一条投诉记录');
			}else{
				$.post('tsxx_get.action',{complaintsId:ids[0]},function(data){
					$.dialog({
						id:'upddialog',
						title:'投诉处理',
						lock:true,
						content:document.getElementById('upd'),
						button:[{
							name:'确定',
							focus: true,
							callback:function(){
								$('#updForm').submit();
								return true;
							}
						}]
					});
					$('#updForm').json2form(data);
				},'json');
			}
		});
		$('#btn_del').click(function(){
			var ids = $('#list').data('checked');
			if(ids.length < 1){
				$.dialog.alert('请选择要删除的报修信息。');
			}else{
				$.dialog.confirm("您确认要删除所选的报修信息吗？",function(){
					$.post('tsxx_del.action',{ids:ids.join(',')},function(data){
						$('#list').page('show');
					},'json');
				});
			}
		});
	});
	var view = function(row){
		$.dialog({
			id:'viewdialog',
			title:'用户投诉',
			lock:true,
			width:'100%',
			height:'100%',
			content:document.getElementById('view')
		});
		$('#viewForm').json2form(row);
	}
	</script>
</head>
<body class="app">
	<h3>投诉信息</h3>
	<form class="search" name="search">
		<div class="tbdiv">
		<table>
			<tr>
				<th>投诉受理机构：</th>
				<td>
					<select>
						<option name="agency" value="">请选择</option>
					</select>
				</td>
				<th>投诉受理单位：</th>
				<td>
					<select>
						<option name="unit" value="">请选择</option>
					</select>
				</td>
				<th>投诉人姓名：</th>
				<td colspan="2"><input type="text" class="inputText" name="cname" value="" style="width:140px;"/></td>
			</tr>
			<tr>
				<th>投诉单号：</th>
				<td><input type="text" class="inputText" name="complaintsId" value="" style="width:110px;"/></td>
				<th>起始时间：</th>
				<td><input type="text" id="st" class="inputText" name="startDate" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'et\')}'})" style="width:110px;"/></td>
				<th>截止时间：</th>
				<td><input type="text" id="et" class="inputText" name="endDate" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'st\')}'})" style="width:110px;"/></td>
				<td><input type="submit" value="查询" class="inputButton"/></td>
			</tr>
		</table>
		</div>
	</form>
	<div id="list"></div>
	<div class="optionlink">
		<span id="btn_upd">【投诉处理】</span>
		<span id="btn_del">【删除所选】</span>
	</div>
	<div class="areaTree"><div id="areaTree" class="ztree"></div></div>
	<div id="view" style="width:350px;display:none;">
		<form name="viewForm" id="viewForm">
		<dl class="view">
			<dt>投诉单号：</dt>
			<dd class="giant"><label name="complaintsId"></label></dd>
			<dt style="height:40px;">内容：</dt>
			<dd class="giant" style="height:40px;"><label name="ccount"></label></dd>
			<div class="cl"></div>
		</dl>
		<dl class="view" style="margin-top:3px;">
			<dt>投诉受理机构：</dt>
			<dd class="giant"><label name="agency"></label></dd>
			<dt>投诉受理单位：</dt>
			<dd class="giant"><label name="unit"></label></dd>
			<div class="cl"></div>
		</dl>
		<dl class="view" style="margin-top:3px;">
			<dt>投诉人姓名：</dt>
			<dd class="giant"><label name="agency"></label></dd>
			<dt>投诉日期：</dt>
			<dd class="giant"><label name="cdate"></label></dd>
			<dt>联系电话：</dt>
			<dd class="giant"><label name="ctel"></label></dd>
			<dt>E-mail：</dt>
			<dd class="giant"><label name="cemail"></label></dd>
			<div class="cl"></div>
		</dl>
		</form>
	</div>
	<div id="upd" style="width:350px;display:none;">
		<form name="updForm" id="updForm" action="tsxx_save.action" method="post">
		<input name="complaintsId" type="hidden" />
		<dl class="view">
			<dt>投诉单号：</dt>
			<dd class="giant"><label name="complaintsId"></label></dd>
			<dt>投诉内容：</dt>
			<dd class="giant"><label name="ccount"></label></dd>
			<dt style="height:52px;">投诉处理意见：</dt>
			<dd class="giant" style="height:52px;"><textarea name="handle" class="inputText" style="width:253px;height:42px;"></textarea></dd>
			<dt>当前状态：</dt>
			<dd class="giant">
				<select name="cstatus">
					<option value="0">未处理</option>
					<option value="1">已处理</option>
				</select>
			</dd>
			<div class="cl"></div>
		</dl>
		</form>
	</div>
</body>
</html>
